﻿using System;
using System.Diagnostics;

namespace YougeBookmark.Utilities
{
    /// <summary>
    /// 简易日志记录工具类
    /// </summary>
    public static class Logger
    {
        /// <summary>
        /// 记录错误日志（输出到调试窗口）
        /// </summary>
        /// <param name="ex">异常对象</param>
        /// <param name="message">自定义消息</param>
        public static void Error(Exception ex, string message)
        {
            Debug.WriteLine($"[ERROR] {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
            Debug.WriteLine($"Message: {message}");
            Debug.WriteLine($"Exception: {ex.GetType().Name}");
            Debug.WriteLine($"Detail: {ex.Message}");
            Debug.WriteLine($"Stack: {ex.StackTrace}");
            Debug.WriteLine(new string('-', 50));
        }
    }
}